#ifndef COLOR_H
#define COLOR_H

#include <cstdint>
#include <functional>

class Color
{
public:
    Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a): r(r), g(g), b(b), a(a) { }
    Color() : Color(255, 255, 255, 255) {};
    inline bool operator==(const Color& c) const { return r == c.r && g == c.g && b == c.b && a == c.a; }
    uint8_t r;
    uint8_t g;
    uint8_t b;
    uint8_t a;
};

template<>
struct std::hash<Color>
{
    size_t operator()(const Color& color) const
    {
        return ((color.r << (unsigned)24) + (color.g << (unsigned)16) + (color.b << (unsigned)8) + color.a);
    }
};

#endif //COLOR_H
